<template xmlns="http://www.w3.org/1999/html">
  <div class="app-container">
    <el-card class="box-card">
      <span slot="header" class="clearfix">
        <span>总资产</span>
      </span>
      <el-row>
        <el-col :span='24'>
          <div class="prop-item">
            <div class="prop-name">余额</div>
            <div class="prop-value">{{accountInfo.balance}}元</div>
            <div class="prop-value">
              <el-button size="mini" type="primary" @click="recharge()">充值</el-button>
              <el-button size="mini" type="primary" plain @click="withdraw()">提现</el-button>
            </div>
          </div>
        </el-col>
        <el-col :span='$isMobile?24:12'>
          <div class="prop-item">
            <div class="prop-name">冻结金额</div>
            <div class="prop-value">{{accountInfo.frozen_balance}}元</div>
          </div>
        </el-col>
<!--        <el-col :span='$isMobile?24:12'>-->
<!--          <div class="prop-item">-->
<!--            <div class="prop-name">账户状态</div>-->
<!--            <div class="prop-value">{{accountInfo.status==1?"正常":"异常"}}</div>-->
<!--          </div>-->
<!--        </el-col>-->
        <el-col :span='$isMobile?24:12'>
          <div class="prop-item">
            <div class="prop-name">押金</div>
            <div class="prop-value">{{accountInfo.deposit}}元</div>
          </div>
        </el-col>
<!--        <el-col :span='$isMobile?24:12'>-->
<!--          <div class="prop-item">-->
<!--            <div class="prop-name">注册时间</div>-->
<!--            <div class="prop-value">{{ parseTime(accountInfo.create_time, '{y}-{m}-{d} {h}:{i}') }}</div>-->
<!--          </div>-->
<!--        </el-col>-->
      </el-row>
    </el-card>
  </div>
</template>

<script>

import accountApi from "@/api/account";

export default {
  name: "account_summary",
  components:{},
  data() {
    return {
      accountInfo:{},
    };
  },

  created() {
    accountApi.getAccountSummary().then(res=>{
      if(res.code == 0 && res.data){
        this.accountInfo = res.data;
      }
    })
  },
  methods: {
    recharge(){
      this.$message({
        message: '您的账户暂不可充值',
        type: 'error'
      })
    },
    withdraw(){
      this.$message({
        message: '您的账户暂不可提现',
        type: 'error'
      })
    }
  }
};
</script>
<style lang="scss" scoped>
  .app-container{
    .box-card {
      .more-operator{
        float: right;
        cursor: pointer;
        color:#1890ff;
      }
      margin-bottom: 10px;

      .prop-item {
        text-align: left;
        font-size: 14px;
        line-height: 20px;
        color: #333;
        margin-bottom: 10px;
        min-height: 30px;
        line-height: 20px;
        display: flex;
        .prop-name{
          display: block;
          text-align: right;
          width: 110px;
          font-weight: 400;
          flex-shrink: 0;
        }
        .prop-value{
          display: block;
          margin-left: 30px;
          text-align: left;
        }
      }
    }
    .station-detail-tabs{

    }
  }
  @media (max-width: 800px) {
    .app-container{
      .box-card {
        .prop-item {
          .prop-name{
            width: 70px;
          }
        }
      }
    }
  }
</style>
